<include file="Public/common" />
<block>
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css"  media="all">
    <style>
        .col-xs-3{margin-top:5px;}
        th{text-align: center;}
    </style>
</block>
<block name="content">
    <div class="page-header"><h1>首页 &gt;财务管理 >  营业收入报表</h1></div>

    <form action="" class="form-inline " method="get" style="margin-left:10px;" >
        <div class="form-group">
            <label for="group_time">成团时间</label>
            <input type="text" class="" name="group_time" readonly id="group_time" placeholder="成团时间" value="{$post.group_time}">
        </div>
        <div class="form-group">
            <label for="group_num">团号</label>
            <input type="text" class="" name="group_num" id="group_num" placeholder="团号" value="{$post.group_num}">
        </div>
        <div class="form-group">
            <label for="line_name">线路名称</label>
            <input type="text" class="" name="line_name" id="line_name" placeholder="线路名称" value="{$post.line_name}">
        </div>
        <div class="form-group">
            <label for="start_time">结算时间</label>
            <input type="text" class="" name="start_time" id="start_time" placeholder="开始日期" value="{$post.start_time}" readonly>
            至
            <input type="text" class="" name="end_time" id="end_time" placeholder="结束日期" value="{$post.end_time}" readonly>
        </div>
        <button type="submit" class="btn btn-primary btn-sm">查询</button>
    </form>
        <div class="col-xs-12"  style="margin-top:10px;">
            <button class="btn btn-primary btn-xs pull-right" type="button" id="dropdownMenu1" data-toggle="dropdown">
                筛选
                <span class="caret"></span>
            </button>
            <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dropdownMenu1" style="padding:10px;">
               <!-- <li><input type="checkbox" class="filtrate" checked value="1" id="filtrate_1"> <label for="filtrate_1">ID</label> </li>-->
                <li><input type="checkbox" class="filtrate"checked value="2" id="filtrate_2"><label for="filtrate_2">订单信息</label></li>
                <!--<li><input type="checkbox" class="filtrate"checked value="3" id="filtrate_3"><label for="filtrate_3">团队类型</label></li>-->
                <li><input type="checkbox" class="filtrate"checked value="4" id="filtrate_4"><label for="filtrate_4">结算时间</label></li>
                <li><input type="checkbox" class="filtrate"checked value="5" id="filtrate_5"><label for="filtrate_5">成团时间</label></li>
                <li><input type="checkbox" class="filtrate"checked value="6" id="filtrate_6"><label for="filtrate_6">总人数</label></li>
                <!--<li><input type="checkbox" class="filtrate"checked value="7" id="filtrate_7"><label for="filtrate_7">单价</label></li>-->
                <!--<li><input type="checkbox" class="filtrate"checked value="8" id="filtrate_8"><label for="filtrate_8">附加产品收入</label></li>-->
                <li><input type="checkbox" class="filtrate"checked value="9" id="filtrate_9"><label for="filtrate_9">结算总额</label></li>
                <!--<li><input type="checkbox" class="filtrate"checked value="10" id="filtrate_10"><label for="filtrate_10">总收入</label></li>-->
                <!--<li><input type="checkbox" class="filtrate"checked value="11" id="filtrate_11"><label for="filtrate_11">单个成本</label></li>-->
                <li><input type="checkbox" class="filtrate"checked value="12" id="filtrate_12"><label for="filtrate_12">总成本</label></li>
                <!--<li><input type="checkbox" class="filtrate"checked value="13" id="filtrate_13"><label for="filtrate_13">附加产品成本</label></li>-->
                <li><input type="checkbox" class="filtrate"checked value="14" id="filtrate_14"><label for="filtrate_14">毛利</label></li>
                <li><input type="checkbox" class="filtrate"checked value="15" id="filtrate_15"><label for="filtrate_15">毛率利</label></li>
            </ul>
            <if condition="checkAuth('Dealer/Finance/exportExcelReport')">
                <a href="{:U('exportExcelReport')}" class="btn btn-primary btn-xs pull-right" style="margin-right: 10px">导出</a>
            </if>

           <span class="pull-right"  style="margin-right:10px;"><b>合计金额：￥{$total}元 合计毛利：￥{$gross}元</b></span>
        </div>
    <table class="table table-striped table-bordered table-hover table-condensed text-center">
        <thead>
            <tr>
                <th class="filtrate_2" >订单信息</th>
                <th class="filtrate_4" >结算时间</th>
                <th class="filtrate_5" >成团时间</th>
                <th class="filtrate_6" >总人数</th>
                <th class="filtrate_9" >结算总额</th>
                <th class="filtrate_12">总成本</th>
                <th class="filtrate_14">毛利</th>
                <th class="filtrate_15">毛利率</th>
            </tr>

        </thead>
        <tbody>
            <volist name="list" id="vo">
                <tr >
                    <td class="filtrate_2">团号:{$vo.group_num},线路:{$vo.line_name}</td>
                    <td class="filtrate_4">{$vo.closing_time|date="Y-m-d",###}</td>
                    <td class="filtrate_5">{$vo.group_time|date="Y-m-d",###}</td>
                    <td class="filtrate_6">{$vo.received_num}</td>
                    <td class="filtrate_9">{$vo.actually_money}</td>
                    <td class="filtrate_12">{$vo.supplier_unit_cost_total}</td>
                    <td class="filtrate_14">{$vo.actually_money-$vo.supplier_unit_cost_total}</td>
                    <td class="filtrate_15">{($vo.actually_money-$vo.supplier_unit_cost_total)/$vo.actually_money*100}%</td>
                </tr>
            </volist>
        <tr>
            <td colspan="8">
                <!--分页样式-->
                <ul class="pagination">
                    {$show}
                </ul>
            </td>
        </tr>
        </tbody>
    </table>

</block>
<block name="js">
<script src=""></script>
<script src="__STATIC__/layui/layui.all.js"></script>
<script src="__STATIC__/layui/layui.js"></script>
<script>
/**
 * 打开订单详情页面
 * @param  {[int]}    orderId     [订单id]
 */

//筛选显示
$('body').on('change','.filtrate',function () {
   var id=$(this).val();
   if($(this).is(':checked')){
        $('.filtrate_'+id).show();
   }else{
       $('.filtrate_'+id).hide();
   }
});

layui.use('laydate', function() {
    var laydate = layui.laydate;
    //常规用法
    laydate.render({
        elem: '#start_time'
    });
    laydate.render({
        elem: '#end_time'
    });

    laydate.render({
        elem: '#group_time'
    });
});

/**
 *订单详情
 * @param orderId
 */

function openDetail(orderId){
    layer.open({
        type: 2,
        offset:20,
        area: ['90%','90%'],
        title: '订单详情',
        content: '{:U("Orders/detail")}',
    })
}
</script>
</block>
